package com.eastseeway.radioproject.entities;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;

import com.eastseeway.radioproject.database.OperationParamsTypeConverter;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

@Entity
@TypeConverters(OperationParamsTypeConverter.class)
public class UserInfo implements Serializable {
    // 显式声明序列化版本号
    private static final long serialVersionUID = 1L;  // 需根据实际版本管理
    @PrimaryKey(autoGenerate = true)
    private int id;

    @ColumnInfo(name = "user_name")
    private String name = "";

    @ColumnInfo(name = "password")
    private String password;

    @ColumnInfo(name = "file_path")
    private String path;

    @ColumnInfo(name = "bar_data")
    private boolean bar_data;

    @ColumnInfo(name = "is_admin")
    private boolean is_admin = false;


//    @TypeConverters(OperationParamsTypeConverter.class)
//    @ColumnInfo(name = "radio_params")
//    private List<OperationParams> radioParams;
//
//
//
//    @ColumnInfo(name = "gmn_params")
//    private List<OperationParams> gmnParams;

    public UserInfo() {
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public boolean isIs_admin() {
        return is_admin;
    }

    public void setIs_admin(boolean is_admin) {
        this.is_admin = is_admin;
    }

//    public List<OperationParams> getRadioParams() {
//        return radioParams;
//    }
//
//    public void setRadioParams(List<OperationParams> radioParams) {
//        this.radioParams = radioParams;
//    }
//
//    public List<OperationParams> getGmnParams() {
//        return gmnParams;
//    }
//
//    public void setGmnParams(List<OperationParams> gmnParams) {
//        this.gmnParams = gmnParams;
//    }

    public boolean isBar_data() {
        return bar_data;
    }

    public void setBar_data(boolean bar_data) {
        this.bar_data = bar_data;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    @Override
    public String toString() {
        return "UserInfo{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", path='" + path + '\'' +
                ", bar_data=" + bar_data +
                ", is_admin=" + is_admin +
                ", radioParams="  +
                ", gmnParams="  +
                '}';
    }
}
